<!DOCTYPE html>
<html lang="zh-cn">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>test</title>
</head>

<body>
  <button id="bt_post">发送消息</button>
  <button id="bt_reply">回消息</button>

</body>


</html>

<script>
  let w1 = new Worker("./test.js");
  w1.addEventListener("message", (evt) => {
    console.log(evt.data)
  })
  document.querySelector("#bt_post").addEventListener("click", () => {
    w1.postMessage("宋慧敏是美女")
  })
</script>
<!-- <script src="./04纯函数与柯里化/03柯里化函数的实现.js"></script> -->
<!-- <script src="./test.js"></script> -->